package com.apes.fn.tms.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * 功能：支线班次明细信息
 *
 * @author Linwz
 * @create 2020-03-06 9:46
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = BranchShiftItem.CONST_TABLE_NAME)
public class BranchShiftItem extends Model {
    public static final String CONST_TABLE_NAME = "tms_branch_shift_item";

    @Id
    @Column(name = "id", length = 10)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "支线班次明细信息")
    @Comment("编码")
    private String id;

    @ManyToOne(optional = false)
    @JoinColumn(name = "branch_shift_id", referencedColumnName = "id")
    @Comment("支线班次信息")
    private BranchShift branchShift;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "branch_shift_time")
    @Comment("支线班次")
    private Date branchShiftTime;  //支线班次 只取时分

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "cutoff_time")
    @Comment("截单时间")
    private Date cutoffTime;  //截单时间 只取时分



}
